Skip to content

Conversation

@jmwright
Copy link
Member

@jmwright jmwright commented Oct 22, 2025

This is a smaller PR which wraps Graphic3d_MaterialAspect XCAFDoc_Material and XCAFDoc_VisMaterial from OCC and leaves open the possibility of adding in physical visualization properties later.

@codecov
Copy link

codecov bot commented Oct 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.79%. Comparing base (fea85a5) to head (678a845).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1923      +/-   ##
==========================================
+ Coverage   95.77%   95.79%   +0.02%     
==========================================
  Files          29       29              
  Lines        7856     7896      +40     
  Branches     1183     1188       +5     
==========================================
+ Hits         7524     7564      +40     
  Misses        192      192              
  Partials      140      140              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jmwright jmwright marked this pull request as ready for review October 23, 2025 14:53
Copy link
Member

@adam-urbanczyk adam-urbanczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand the intent of this PR correctly, you actually want to use XCAFDoc_Material

@jmwright
Copy link
Member Author

@adam-urbanczyk I need to better understand what you are thinking. The current Material class wraps Graphic3d_MaterialAspect and so it is more visualization based, but my thought was to add things like density as properties later. XCAFDoc_Material does not seem to gain us much in the way is physical properties. My intention is to create a more general-purpose material class that can be used for multiple purposes, including export. It could be possible to wrap multiple classes and have the properties be interfaces to each of those properties. So the "diffuse color" would get/set on Graphic3d_MaterialAspect, and "density" would be get/set on XCAFDoc_Material.

@adam-urbanczyk
Copy link
Member

adam-urbanczyk commented Oct 23, 2025

In the end this class should wrap XCAFDoc_VisMaterial and XCAFDoc_Material (thus not Graphic3d_*). I assume that the first (main) use case is not vis related, so XCAFDoc_Material should be prioritized.

NB: it can be used for now to simply store a name.

@jmwright
Copy link
Member Author

@adam-urbanczyk How about this?

@adam-urbanczyk
Copy link
Member

Ok, let me take a look.

Copy link
Member

@adam-urbanczyk adam-urbanczyk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good in general, but could you implement pickling? If it is too much work you could for now get rid of the vis part.

@jmwright
Copy link
Member Author

could you implement pickling?

@adam-urbanczyk I'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants